package com.jt.www.domain.enums.pc;

/**
 * 线下业务产品类型
 * Created by shaoyn on 2020/08/06.
 */
public enum OfflineUserTypeEnum {

    COMPANY("00", "企业"),
    INDIVIDUAL("01", "自然人");

    private String type;

    private String desc;

    OfflineUserTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    /**
     * 通过type得到实体
     *
     * @return
     */
    public static OfflineUserTypeEnum getEnumByType(String type) {
        for (OfflineUserTypeEnum userType : OfflineUserTypeEnum.values()) {
            if (userType.type.equals(type)) {
                return userType;
            }
        }
        return OfflineUserTypeEnum.COMPANY;
    }


    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }
}
